﻿<UserControl x:Class="NavigationMVVMDemo.Views.Theme1.PersonView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <TextBox x:Name="txtFirstName"
                 Grid.Row="0"
                 Width="100"
                 Text="{Binding Person.FirstName}"/>
        
        <TextBox x:Name="txtLastName"
                 Grid.Row="1"
                 Width="100"
                 Text="{Binding Person.LastName}"/>
        
        <ListBox x:Name="lstPhoneNumbers"
                 ItemsSource="{Binding Person.PhoneNumbers}"
                 Grid.Row="2">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding AreaCode}"/>
                        <TextBox Text=" - "/>
                        <TextBlock Text="{Binding Number}"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        
        <Button x:Name="btnAddPhoneNumber"
                Content="Add Phone Number"
                Grid.Row="3"
                Command="{Binding AddPhoneNumberCommand}"/>
    </Grid>
</UserControl>
